home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / cmds / cc / cc_mips.man < prev    next >
Encoding:
Text File  |  1991-01-08  |  10.6 KB  |  331 lines

  1.  
  2.  
  3.  
  4.                                                             cc(1)
  5.  
  6.  
  7.  
  8. NAME
  9.      cc - C compiler
  10.  
  11. SYNTAX
  12.      cc [option...] file...
  13.  
  14. DESCRIPTION
  15.      The cc command invokes the ULTRIX C compiler and accepts the
  16.      following types of arguments:
  17.  
  18.      +    Arguments whose names end with .c
  19.  
  20.      +    Arguments whose names end with .s
  21.  
  22.      +    Other arguments that are interpreted as either loader
  23.           option arguments or C-compatible object programs
  24.  
  25.      Arguments ending in .c are interpreted as C source programs.
  26.      They are compiled, and each object program is left on a file
  27.      whose name is the same as the source file except .o is sub-
  28.      stituted for .c.  If a single C program is compiled and
  29.      loaded all at once, the .o file is deleted.
  30.  
  31.      Arguments ending with .s are interpreted as assembly source
  32.      programs.  They are assembled, producing an .o file.
  33.  
  34.      Arguments other than those ending with .c or .s were pro-
  35.      duced by previous cc runs or by libraries of C-compatible
  36.      routines.
  37.  
  38.      The first argument passed to the ld(1) loader is always one
  39.      of the three crt0 files used for start up.  The compiler
  40.      uses /lib/mcrt0.o when the -p flag is given,
  41.      /usr/lib/gcrt0.o when the -pg is given, and /lib/crt0.o oth-
  42.      erwise.  If loading executables by hand, you must include
  43.      the appropriate file.
  44.  
  45. OPTIONS
  46.      These options are accepted by cc. See ld(1) for load-time
  47.      options.
  48.  
  49.      -b                  Does not pass -lc to ld(1) by default.
  50.  
  51.      -Bstring            Finds substitute compiler passes in the
  52.                          files named string with the suffixes
  53.                          cpp, ccom, and c2.
  54.  
  55.      -c                  Suppresses the loading phase of the com-
  56.                          pilation and forces an object file to be
  57.                          produced even if only one program is
  58.                          compiled.
  59.  
  60.  
  61.  
  62.  
  63.                                                                 1
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. cc(1)
  71.  
  72.  
  73.  
  74.      -C                  Stops the macro preprocessor from omit-
  75.                          ting comments.
  76.  
  77.      -Dname=def
  78.      -Dname              Defines the name to the processor, as if
  79.                          by #define.  If no definition is given,
  80.                          the name is defined as 1.
  81.  
  82.      -E                  Runs only the macro preprocessor on the
  83.                          named C programs and sends the result to
  84.                          the standard output.
  85.  
  86.      -Em                 Runs only the macro preprocessor on the
  87.                          named C programs and produces the
  88.                          makefile dependencies.
  89.  
  90.      -f                  Specifies that computations involving
  91.                          only FFLOAT numbers be done in single
  92.                          precision and not promoted to double.
  93.                          Procedure arguments are still promoted
  94.                          to double.  Programs with a large number
  95.                          of single-precision computations will
  96.                          run faster with this option; however, a
  97.                          slight loss in precision may result due
  98.                          to the saving of intermediate results in
  99.                          a single-precision representation.
  100.  
  101.      -g                  Directs the compiler to produce addi-
  102.                          tional symbol table information for
  103.                          dbx(1).  Also passes the -lg flag to
  104.                          ld(1).
  105.  
  106.      -Idir               Searches first in the directory of the
  107.                          file argument for #include files whose
  108.                          names do not begin with a backslash (\),
  109.                          then in directories named in -I options,
  110.                          and, finally, in directories on a stan-
  111.                          dard list.
  112.  
  113.      -lx                 Abbreviates the library name
  114.                          /lib/libx.a, where x is a string.  If
  115.                          that library name does not exist, ld
  116.                          searches /usr/lib/libx.a and then
  117.                          /usr/local/lib/libx.a.  The placement of
  118.                          the -l library option is significant
  119.                          because a library is searched when its
  120.                          name is encountered.
  121.  
  122.      -M                  Specifies the floating point type to be
  123.                          used for double-precision floating point
  124.                          and is passed on to ld(1) as the map
  125.                          option.
  126.  
  127.  
  128.  
  129. 2
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.                                                             cc(1)
  137.  
  138.  
  139.  
  140.      -Md                 Specifies the default DFLOAT and passes
  141.                          the -lc flag to ld(1).
  142.  
  143.      -Mg                 Specifies GFLOAT and passes the -lcg
  144.                          flag to ld(1), causing the GFLOAT ver-
  145.                          sion of libc to be used.  If the math
  146.                          library is used with code compiled with
  147.                          the -Mg flag, it is linked to the GFLOAT
  148.                          version by specifying -lmg on the cc(1)
  149.                          or ld(1) command.
  150.  
  151.      -o output           Names the final output file output.  If
  152.                          this option is used, the file a.out is
  153.                          left alone.  If the named file has
  154.                          either .o or .a as a suffix, the follow-
  155.                          ing error message is displayed: -o would
  156.                          overwrite.
  157.  
  158.      -O                  Uses the object code optimizer.
  159.  
  160.      -p                  Arranges for the compiler to produce
  161.                          code which counts the number of times
  162.                          each routine is called.  If loading
  163.                          takes place, the -p option replaces the
  164.                          standard startup routine with one that
  165.                          automatically calls monitor(3) and that
  166.                          arranges to write out a mon.out file at
  167.                          normal termination of execution of the
  168.                          object program.  An execution profile
  169.                          can then be generated using prof(1).
  170.  
  171.      -pg                 Causes the compiler to produce counting
  172.                          code as with -p, but invokes a run-time
  173.                          recorder that keeps more extensive
  174.                          statistics and produces a gmon.out file.
  175.                          Also, the -pg option searches a profil-
  176.                          ing library in lieu of the standard C
  177.                          library.  An execution profile can then
  178.                          be generated by using gprof(1).
  179.  
  180.      -R                  Passed on to as, which makes initialized
  181.                          variables shared and read-only.
  182.  
  183.      -S                  Compiles programs and writes output to
  184.                          .s files.
  185.  
  186.      -t [p02al]          Finds the designated compiler passes in
  187.                          the files whose names are constructed by
  188.                          a -B option.  In the absence of a -B
  189.                          option, the string is taken to be
  190.                          /usr/c/.
  191.  
  192.  
  193.  
  194.  
  195.                                                                 3
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. cc(1)
  203.  
  204.  
  205.  
  206.      -Uname              Removes any initial definition of name.
  207.  
  208.      -w                  Suppresses warning diagnostics.
  209.  
  210.      -Yenvironment       Compiles C programs for environment.  If
  211.                          environment is SYSTEM_FIVE or is omit-
  212.                          ted, it defines SYSTEM_FIVE for the
  213.                          preprocessor, cpp. If the loader is
  214.                          invoked, it specifies that the System V
  215.                          version of the C runtime library is
  216.                          used.  Also, if the math library is
  217.                          specified with the -lm option, the Sys-
  218.                          tem V version is used.  If environment
  219.                          is POSIX, it defines POSIX for the
  220.                          preprocessor.  If the environment vari-
  221.                          able PROG_ENV has the value SYSTEM_FIVE
  222.                          or POSIX, the effect is the same as when
  223.                          specifying the corresponding -Yenviron-
  224.                          ment option to cc. The -Y option over-
  225.                          rides the PROG_ENV variable; -YBSD can
  226.                          be used to override all special actions.
  227.  
  228. DEFAULT SYMBOLS
  229.      The ULTRIX C compiler provides the following default symbols
  230.      for your use.  These symbols are useful in ifdef statements
  231.      to isolate code for one of the particular cases. Thus, these
  232.      symbols can be useful for ensuring portable code.
  233.  
  234.           unix           Any UNIX system
  235.           bsd4_2         Berkeley UNIX Version 4.2
  236.           ultrix         ULTRIX only
  237.           vax            VAX only (as opposed to PDP-11)
  238.  
  239. RESTRICTIONS
  240.      The compiler ignores advice to put char, unsigned char,
  241.      short or unsigned short variables in registers.
  242.  
  243.      If the -Mg flag is used to produce GFLOAT code, it must be
  244.      used when compiling all the modules which will be linked.
  245.      Use the -Mg flag if you use the cc command to invoke ld(1)
  246.      indirectly to link the modules.  If ld(1) is invoked
  247.      directly, use the -lcg flag rather than -lc. If the math
  248.      library is used, specify the -lmg flag rather than the -lm
  249.      flag in order to use the GFLOAT version.
  250.  
  251.      The compiler and the linker ld(1) cannot detect the use of
  252.      mixed double floating point types.  If you use them, your
  253.      program's results may be erroneous.
  254.  
  255. DIAGNOSTICS
  256.      The diagnostics produced by C are intended to be self-
  257.      explanatory.  Occasional messages may be produced by the
  258.  
  259.  
  260.  
  261. 4
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.                                                             cc(1)
  269.  
  270.  
  271.  
  272.      assembler or loader.
  273.  
  274. FILES
  275.      file.c         input file
  276.      file.o         object file
  277.      a.out          loaded output
  278.      /tmp/ctm?      temporary
  279.      /lib/cpp       preprocessor
  280.      /lib/ccom      compiler
  281.      /lib/c2        optional optimizer
  282.      /lib/crt0.o    runtime startoff
  283.      /lib/mcrt0.o   startoff for profiling
  284.      /usr/lib/gcrt0.ostartoff for gprof-profiling
  285.      /lib/libc.a    standard library, see intro(3)
  286.      /usr/libcg.a   GFLOAT version of the standard library, see
  287.      intro(3)
  288.      /usr/lib/libc_p.aprofiling library, see intro(3)
  289.      /usr/include   standard directory for #include files
  290.      mon.out        file produced for analysis by prof(1)
  291.      gmon.out       file produced for analysis by gprof(1)
  292.  
  293. SEE ALSO
  294.      adb(1), as(1), cpp(1), dbx(1), gprof(1), ld(1), prof(1),
  295.      monitor(3)
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.                                                                 5
  328.  
  329.  
  330.  
  331.